<?php
session_start();
$user = $_SESSION['username'];
	
	if(!isset($user)){ 
		die("Anda belum Login, silahkan kembali ke halaman awal anda");
	}
?>
<html lang="en">
<head>
	<link type="text/css" rel="stylesheet" href="css/bootstrap.css"/>
	<title>Jajanan Ngalam</title>
</head>
<header>  
<div class="hero-unit" style="margin-left:70px; margin-top:70px; margin-right:80px">
		<h1><font face="comic sans MS" color="green">JAJANAN NGALAM</font></h1>
		<p><font face="comic sans MS" size=4> Website Integrasi pedagang jajanan asli kota Malang </font></p>
	</div>
</header>
<body style= "background-image:url(images/blue.jpg)">
<div class="hero-unit" style="width:80%%; height:auto; margin-left:70px;">
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="row">
				<div class="span9">	
					<div class="navbar">
						<div class="navbar-inner" style="margin-left:20; margin-right:20">
						<a class="brand">PENJUAL</a>
							<ul class="nav">
								<li><a href="form-daftar-akun.php">Home</a></li>
								<li><a href="form-daftar-produk.php">Produk</a></li>
								<li><a href="map_penjual.php">Lokasi Jajanan</a></li>
								<li class="active"><a href="kritik_saran.php">Kritik dan Saran</a></li>
							</ul>
						</div>
						<div class="container-fluid">
							<div class="well span12">
							<form method="POST" >
								<div class="control-group">
								
									<div class="controls">
										<font style="color: black" size="5">Kolom Komentar</font>
										<br></br>
										<label class="control-label" for="textarea">Nama</label>
										<input type="text" name="nama" >
									</div>
								</div>
								<div class="control-group">
									<div class="controls">
										<label class="control-label" for="textarea">Komentar anda</label>
										<textarea class="input-xlarge" name="komentar" rows="3" ></textarea>
									</div>
										<button type="submit" name="komen" class="btn">Komentari</button>
								</div>
							</form>
							<a>
								<?php
									include 'fungsi.php';
									$hasil = new fungsi();
									$hasil->konek();
										if(isset($_POST['komen'])){
										$nama = $_POST['nama'];
										$komentar = $_POST['komentar'];
											$hasil->komen($nama,$komentar);		
											?>
											<script language="javascript" >
												alert ("Terima Kasih Saran Anda Kami Terima :) ");
												document.location= 'kritik_penjual.php';
											</script>
								<?php
								}
										$liat=$hasil->liatkomen();
											while($rows = mysql_fetch_array($liat)){
												echo '<table class="table table-bordered">
															<tr>
																<td>
																	<font style="color:black" align="left" size=2>'.$rows['nama'].'</font>
																	<p align="left"><font size=2>'.$rows['komentar'].'</font></p>
																</td>
															</tr>
														</table>';
												}
								?> 
								
							</a>
							</div>
						</div>
					</div>
				</div>	
				<form class="well span3" method="POST" action="logout.php">
					<h4>Hai, <?php $cek=$_SESSION['username']; echo $cek; ?> !</h4>
					<button type="submit" class="btn">Keluar</button>
				</form>
			</div>
		</div>
	</div>
</div>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/bootstrap.js"></script>
	<script src="js/bootstrap-tab.js"></script>
</body>
<footer>
	<div class="hero-unit" style="margin-left:70px; margin-bottom:70px; margin-right:80px">
	</div>
</footer>
</html>
